# coding: utf-8

from celery import Celery

try:
    import schedule_env   # 请勿删除
except:
    pass

from common.schedule.config import CELERY_RESULT_BACKEND

celery_app = Celery(
    'seven_moor_celery',
    include=[
        'common.schedule.seven_moor_tasks',
        'common.schedule.new_seven_moor_tasks'
    ]
)

celery_app.config_from_object('common.schedule.seven_moor_config')
celery_app.conf.ONCE = {
    'backend': 'celery_once.backends.Redis',
    'settings': {
        'url': CELERY_RESULT_BACKEND,
        'default_timeout': 60 * 60
    }
}

if __name__ == '__main__':
    celery_app.start()
